03. Schemas

JAVA C2 L3 03 Schemas

The GraphQL schema defines the data points offered via an API. The schema contains the data types and relationships between them and the set of operations available, things like queries for retrieving data and mutations for creating, updating, and deleting data.

The schema from the Case Study is shown below.

type Location {
 id: ID!
 name: String!
 address: String!
}

type Query {
 findAllLocations: [Location]!
}

type Mutation {
 newLocation(name: String!, address: String) : Location!
 deleteLocation(id:ID!) : Boolean
 updateLocationName(newName: String!, id:ID!) : Location!
}

There can be multiple root Query and Mutation types in a single schema.

SOLUTION: False

What is the file extension for a GraphQL schema file?

SOLUTION: .graphqls